package Entity;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Question {
    //难度级别(方式一)
    public static final int LEVEL1 = 1;
    public static final int LEVEL2 = 2;
    public static final int LEVEL3 = 3;
    public static final int LEVEL4 = 4;
    public static final int LEVEL5 = 5;
    public static final int LEVEL6 = 6;
    public static final int LEVEL7 = 7;
    public static final int LEVEL8 = 8;
    public static final int LEVEL9 = 9;
    public static final int LEVEL10 = 10;
    //难度级别(方式二)
    public static final int MIN_LEVEL = 1;
    public static final int MAX_LEVEL = 10;

    /** 单选题 */
    public static final int SINGLE_SELECTION = 0;
    /** 多选题 */
    public static final int MULTI_SELECTION = 1;

    private int id;
    private String title;// 题干
    private List<String> options = new ArrayList<String>();// 若干选项
    private List<Integer> answers = new ArrayList<Integer>();// 正确答案
    private int score;// 分数
    private int level;// 难度级别
    private int type; // 类型: 单选 SINGLE_SELECTION /多选 MULTI_SELECTION


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public List<String> getOptions() {
        return options;
    }

    public void setOptions(List<String> options) {
        this.options = options;
    }

    public List<Integer> getAnswers() {
        return answers;
    }

    public void setAnswers(List<Integer> answers) {
        this.answers = answers;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    //自定义重写toString()
    public String toString() {
        StringBuffer sb = new StringBuffer(title + "\n");
        for (int i = 0; i < options.size(); i++) {
            sb.append((char) (i + 'A') + "." + options.get(i) + "\n");
        }
        // sb.append("正确答案：");
        // for(int i=0;i<answer.size();i++){
        // sb.append((char)(answer.get(i)+'A')+",");
        // }
        sb.append("\n");
        return sb.toString();
    }

}
